package com.itheima.stock.controller.v1;

import com.itheima.stock.api.UserControllerAPI;
import com.itheima.stock.dto.LoginDTO;
import com.itheima.stock.response.ResponseResult;
import com.itheima.stock.service.UserService;
import com.itheima.stock.vo.CaptchaVO;
import com.itheima.stock.vo.LoginVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @文件名: Usercontorller
 * @作者: DX
 * @创建日期: 2025/10/23
 * @描述:
 */
@RestController
public class Usercontorller implements UserControllerAPI {

    @Autowired
    private UserService userService;

    @Override
    public ResponseResult<LoginVO> login(LoginDTO loginDto) {
        return ResponseResult.ok( userService.login(loginDto));
    }

    @Override
    public ResponseResult<CaptchaVO> Captcha() {
        return ResponseResult.ok(userService.Captcha());
    }

    @Override
    public String test( String name) {
        return  "hello " + name;
    }
}
